home *** CD-ROM | disk | FTP | other *** search
- /*
- InvisiWin FKey #7 -- Version 1.1 -- Nov 28, 1988
-
- Copyright (c) 1988-89 by Neal E. Trautman & Josh Pritikin
-
- 'ShareWare' -- Please send $3 contribution to:
- Neal Trautman
- 1701 S.W. 42nd Street
- Fargo, ND 58103
-
- and a $.20 contribution to: ( <- just kidding)
- Josh Pritikin
- 1404 Greenworth Place
- Santa Barbara, CA 93108
-
- This FKey makes the content region of the front window transparent.
- (If it is already transparent, the content region returns)
-
- 8.7.89 - Updated so that option flips all the windows in an application
- by Josh Pritikin. GEnie J.Pritikin.
-
- This modification is real useful if you use multifinder because
- you can hide all of the windows in an application, to speed
- updating. I also make a quickey combination (control-space) to
- make it easier to run the fkey. Who needs Sys 7.0 with it's
- layer hiding abilities?
- */
-
- main()
- {
- register WindowPeek win;
- register RgnHandle cont;
- register long keys[4];
- register Boolean wasVis;
-
- win = (WindowPeek)FrontWindow();
- if (!win) {
- SysBeep(1);
- return;
- }
-
- cont = win->contRgn;
-
- GetKeys(keys);
- if ((keys[1] >> 3) & 0x01) {
- if (EmptyRgn(cont)) {
- wasVis = false;
- WinVis(win);
- } else {
- wasVis = true;
- WinInv(win);
- }
- win = win->nextWindow;
-
- while(win != 0l) {
- if (!win->visible) goto nxt;
-
- cont = win->contRgn;
- if (EmptyRgn(cont)) {
- if (!wasVis) {
- WinVis(win);
- }
- } else {
- if (wasVis) {
- WinInv(win);
- }
- }
-
- nxt:
- win = win->nextWindow;
- }
- } else {
- if (EmptyRgn(cont)) WinVis(win);
- else WinInv(win);
- }
- }
-
- WinVis(win)
- WindowPeek win;
- {
- ShowHide(win, false);
- ShowHide(win, true);
- }
-
- WinInv(win)
- WindowPeek win;
- {
- register RgnHandle cont;
-
- cont = win->contRgn;
- win->contRgn = NewRgn();
- DiffRgn(win->strucRgn, cont, win->strucRgn);
- CalcVisBehind(win, cont);
- PaintBehind(win, cont);
- DisposeRgn(cont);
- }
-
-